
const { program, InvalidArgumentError } = require('commander');

program
  .option('-n, --number <numbers>', 'this is a number')
  .option('-t, --time <times...>', 'this is a number')
  .action(async (options) => {
    await main(options.number, options.time);
  });

  program.parseAsync(process.argv)
  .then(() => {
    console.log('DONE');
    process.exit(0);
  })
  .catch((err) => {
    console.error(err);
    process.exit(1);
  });

async function main(numbers,times) {
  console.log('numbers=' + numbers);
  console.log('times=' + times);
  const time = times[0];
  console.log('times=' + time);
}